return {
  --[[
    o 打开关闭文件夹
    a 创建文件
    r 重命名
    x 剪切
    c 拷贝
    p 粘贴
    d 删除
  ]]
  "nvim-tree/nvim-tree.lua",
  enabled = true,
  version = "*",
  before = { "oil", "mini.files" }, --  当前插件在 oil和mini.files 之前加载
  dependencies = {
    "nvim-tree/nvim-web-devicons",
  },
  config = function()
    vim.g.loaded_netrw = 1
    vim.g.loaded_netrwPlugin = 1
    vim.opt.termguicolors = true

    vim.g.nvim_tree_window_picker_exclude = {
      filetype = { "notify", "packer", "qf" },
      buftype = { "terminal" },
    }

    local opts = function(desc)
      return { noremap = true, silent = true, desc = desc }
    end

    vim.keymap.set(
      "n",
      "<leader>ee",
      "<cmd>NvimTreeToggle<CR>",
      opts("Toggle file explorer")
    ) -- toggle file explorer
    vim.keymap.set(
      { "n" },
      "<leader>eo",
      "<cmd>NvimTreeFocus<cr>",
      opts("Toggle file explorer on focus file")
    )
    -- vim.keymap.set(
    --   "n",
    --   "<leader>ef",
    --   "<cmd>NvimTreeFindFileToggle<CR>",
    --   opts "Toggle file explorer on current file"
    -- ) -- toggle file explorer on current file
    -- vim.keymap.set(
    --   "n",
    --   "<leader>ec",
    --   "<cmd>NvimTreeCollapse<CR>",
    --   opts "Collapse file explorer"
    -- ) -- collapse file explorer
    -- vim.keymap.set(
    --   "n",
    --   "<leader>er",
    --   "<cmd>NvimTreeRefresh<CR>",
    --   opts "Refresh file explorer"
    -- ) -- refresh file explorer
    -- vim.keymap.set(
    --   { "n" },
    --   "<leader>ef",
    --   "<cmd>NvimTreeFindFile<cr>",
    --   opts "Toggle file explorer on current file"
    -- )
    --
    require("nvim-tree").setup({
      sort = {
        sorter = "case_sensitive",
      },
      view = {
        side = "left",
        width = 30,
        relativenumber = false,
        centralize_selection = false,
      },
      notify = {
        threshold = vim.log.levels.WARAN,
        absolute_path = false,
      },
      -- change folder arrow icons
      renderer = {
        indent_markers = {
          enable = false,
          inline_arrows = true,
          icons = {
            corner = "└",
            edge = "│",
            item = "│",
            bottom = "─",
            none = " ",
          },
        },
        icons = {
          git_placement = "after", -- before after
          modified_placement = "before",
          glyphs = {
            folder = {
              arrow_closed = "",
              arrow_open = "",
              -- arrow_closed = "",
              -- arrow_open = "",

              -- arrow_closed = "", -- arrow when folder is closed
              -- arrow_open = "", -- arrow when folder is open
            },
            git = {
              unstaged = "✗",
              staged = "✓",
              unmerged = "", -- "⌥",
              renamed = "➜",
              untracked = "★",
              deleted = "⊖", -- "",
              ignored = "◌",
            },
          },
        },
      },
      -- disable window_picker for
      -- explorer to work well with
      -- window splits
      actions = {
        open_file = {
          -- 首次打开大小适配
          resize_window = true,
          -- 打开文件时不关闭
          quit_on_open = true,
          window_picker = {
            enable = false,
          },
        },
      },
      git = {
        enable = true,
      },
      filters = {
        dotfiles = false,
        custom = {
          "^.git$",
          "^node_modules$",
          "^target$", -- rust
          "^.vscode$",
          "^.DS_Store$",
        },
      },
      -- keymap override
      on_attach = function(buffer_id)
        local api = require("nvim-tree.api")

        local options = function(desc)
          return {
            desc = "nvim-tree: " .. desc,
            buffer = buffer_id,
            noremap = true,
            silent = true,
            nowait = true,
          }
        end
        -- use add default mappings
        api.config.mappings.default_on_attach(buffer_id)

        vim.keymap.set(
          "n",
          "sv",
          api.node.open.vertical,
          options("Open: Vertical Split")
        )
        vim.keymap.set(
          "n",
          "sh",
          api.node.open.horizontal,
          options("Open: Horizontal Split")
        )
      end,
    })
  end,
}
